package homework38;

public class FunctionButton {//功能键类：请求发送者...
    private String name;//功能键名称
    private Command command;//维持一个抽象命令对象的引用
    public FunctionButton (String name){
        this.name = name;
    }
    public String getName(){
        return this.name;
    }
    public void setName(String name){
        this.name = name;
    }
    public void setCommand(Command command){//设计功能命令
        this.command = command;
    }
    public void onClick(){//发送请求方式...
        System.out.println("点击功能键：");
        command.execute();
    }
}
